package com.tuanzi.loan.web.lazy.system;

import com.tuanzi.loan.business.service.system.AdvertiseService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.system.AdvertiseSearchRequest;
import com.tuanzi.loan.vo.response.system.AdvertiseSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class AdvertiseLazyDataModel extends LazyDataSessionModel<AdvertiseSearchRequest, AdvertiseSearchResponse> {

	private static final long serialVersionUID = 9143007553234885156L;

	private AdvertiseService advertiseService;

	public AdvertiseLazyDataModel(AdvertiseSearchRequest searchRequest, CurrentUserBean session, AdvertiseService advertiseService) {
		super(searchRequest, session);
		this.advertiseService = advertiseService;
	}

	@Override
	protected Page<AdvertiseSearchResponse> doLoad0(PageSearcher<AdvertiseSearchRequest> pageSearcher) {
		return advertiseService.list(pageSearcher);
	}
}
